﻿
Partial Public Class mitglied_erstellen
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim user1 As New Mitgliede_Anwaerter


        Dim a As New Random(10000000)

        Dim b As Int32 = a.Next(5000000, 10000000)
        With user1
            Dim vorn = txt_vorname.Text
            Dim nachn = txt_nachname.Text
            .Vorname = vorn
            .Nachname = nachn
            .Email_HC = LCase(vorn(0)) + "." + LCase$(nachn) + "@hanseaticconsulting.de"
            .E_Mail_privat = txt_email.Text
            .Passwort = b
        End With
        Dim db As New hc_databaseDataContext
        db.mitgliede_anwaerter.InsertOnSubmit(user1)
        db.SubmitChanges()

        Response.Write(b)

    End Sub
End Class